Repository Public
1/**2 * =============================================================================3 * SP BOUCHER | SOFTWARE & RESEARCH4 * ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * Project : Vrai-Prix8 * File : src/app/a-vendre/[uid]/evaluer/page.tsx9 * Module : app10 * Repository : https://git.spboucher.ai/vrai-prix11 * Created : 2026-09-0812 * Last Modified : 2026-09-0813 *14 * Author : Simon-Pierre Boucher15 * Position : Professor of Finance16 * Institution : Université du Québec en Outaouais (UQO)17 * Organization : SP Boucher18 * Website : https://spboucher.ai19 * Git : https://git.spboucher.ai20 *21 * Preferred Contact: contact@spboucher.ai22 * Development : dev@spboucher.ai23 * Support : support@spboucher.ai24 * Security/Admin : admin@spboucher.ai25 *26 * Copyright (c) 202627 * Simon-Pierre Boucher28 * All rights reserved where applicable. This file is governed by the29 * applicable project license, copyright notices and relevant law.30 * Existing third-party rights and notices remain unaffected.31 *32 * License : None specified (no license file in this repository)33 *34 * Do not embed credentials, private keys, access tokens,35 * certificates or confidential personal information.36 *37 * =============================================================================38 * END OF SP BOUCHER SOURCE HEADER39 * =============================================================================40 */4142// /a-vendre/{uid}/evaluer : l'atelier de comparables. L'utilisateur choisit ses comparables,43// les ajuste, conclut sa valeur et la confronte aux mesures du moteur et au prix demandé.44import type { Metadata } from "next";45import { notFound } from "next/navigation";46import { Atelier, type TeteAtelier } from "@/components/avendre/atelier/Atelier";47import { titreAnnonce } from "@/components/avendre/annonce";48import { fmtPrix } from "@/lib/format";49import { getListing } from "@/lib/immoka";5051export const dynamic = "force-dynamic";5253function tete(uid: string): TeteAtelier | null {54 const det = getListing(uid);55 if (!det) return null;56 const l = det.listing;57 const e = det.eval;58 return {59 uid: l.uid,60 titre: titreAnnonce({ address: l.address, group: det.group, city: l.city }),61 city: e?.municipalite ?? l.city,62 group: det.group,63 price: l.price,64 image: det.images[0] ?? null,65 bedrooms: l.bedrooms,66 areaSqft: l.area_sqft,67 yearBuilt: l.year_built,68 geolocated: l.lat != null && l.lng != null,69 eval: e70 ? {71 est: e.est,72 low: e.low,73 high: e.high,74 confidence: e.confidence,75 modelEst: e.model_est,76 compsEst: e.comps_est,77 costEst: e.cost_est,78 roleEst: e.role_est,79 ensEst: e.ens_est,80 valeurRole: e.valeur_role,81 nComps: e.n_comps,82 unitId: e.unit_id,83 evaluatedAt: e.evaluated_at,84 }85 : null,86 };87}8889export async function generateMetadata({ params }: { params: Promise<{ uid: string }> }): Promise<Metadata> {90 const { uid } = await params;91 const t = tete(decodeURIComponent(uid));92 if (!t) return { title: "Inscription introuvable", robots: { index: false } };93 return {94 title: `Mon évaluation : ${t.titre}${t.city ? `, ${t.city}` : ""} (prix demandé ${fmtPrix(t.price)})`,95 description: "Atelier de comparables : choisir ses ventes comparables, les ajuster en dollars, conclure une valeur et la confronter à la valeur estimée et au prix demandé.",96 robots: { index: false, follow: false },97 };98}99100export default async function EvaluerPage({ params }: { params: Promise<{ uid: string }> }) {101 const { uid } = await params;102 const t = tete(decodeURIComponent(uid));103 if (!t) notFound();104 return <Atelier tete={t} />;105}106